# -*- coding: utf-8 -*- 
# 作者:飞虎
# 开发时间:2022/5/11 20:21
from PyQt5.Qt import *


class Window(QWidget):
	def __init__(self):
		super().__init__()
		self.setWindowTitle('QSlider学习')
		self.resize(500, 500)
		self.setup_ui()

	def setup_ui(self):
		sd = QSlider(self)
		sd.move(200,200)
		sd.resize(30,200)
		# sd.setTickPosition(QSlider.TicksLeft)
		# sd.setTickPosition(QSlider.TicksRight)
		sd.setTickPosition(QSlider.TicksBothSides)
		# sd.setPageStep(5)
		sd.setTickInterval(5)

		sd.valueChanged.connect(lambda val:print(val))


if __name__ == '__main__':
	import sys

	app = QApplication(sys.argv)
	window = Window()
	window.show()
	sys.exit(app.exec_())